﻿using Mail.MiniProgram.Core.Common;
using Mail.MiniProgram.Core.Helpers;
using System;
using System.Collections.Generic;
using System.Text;

namespace Mail.MiniProgram.Core.WorkWechat
{
    public  class ServerApi
    {

        public const string API_URL = "https://qyapi.weixin.qq.com/cgi-bin";
        /// <summary>
        ///  获取企业 AccessToken 调用企业接口使用
        /// </summary>
        /// <param name="corpId"></param>
        /// <param name="corpSecret"></param>
        public static BaseAccessTokenResult GetToken(string corpId, string corpSecret)
        {

            var url = string.Format(API_URL + "/gettoken?corpid={0}&corpsecret={1}", corpId, corpSecret);
            return HttpHelper.Get<BaseAccessTokenResult>(url);
        }

        
    }

    
}
